//
//  LXUserImageViewCell.m
//  LvXi_newVersion
//
//  Created by 诸葛孔明 on 16/8/16.
//  Copyright © 2016年 SJT. All rights reserved.
//............................................................................................//
//...........................................个人中心-账户设置页面-用户头像cell...........................................//
//............................................................................................//
#import "LXUserImageViewCell.h"

@implementation LXUserImageViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
//        self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
        UILabel *nameLabel = [[UILabel alloc] init];
        nameLabel.font = [UIFont systemFontOfSize:15];
        [self addSubview:nameLabel];
        self.nameLabel = nameLabel;
        
        UIImageView *userImageView = [[UIImageView alloc] init];
        [self addSubview:userImageView];
        self.userImageView = userImageView;
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    self.nameLabel.width = [self.nameLabel.text sizeInAre:MaxSize font:self.nameLabel.font].width;
    self.nameLabel.height = [self.nameLabel.text sizeInAre:MaxSize font:self.nameLabel.font].height;
    self.nameLabel.x = MineRatio(18)+10;
    self.nameLabel.y = (self.height - self.nameLabel.height) / 2;
    
    self.userImageView.width = MineRatio(40);
    self.userImageView.height = self.userImageView.width;
    self.userImageView.y = (self.height - self.userImageView.height) / 2;
    self.userImageView.x = self.width - self.userImageView.width - MineRatio(24);
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
//    [super setSelected:selected animated:animated];
}

@end
